package com.github.kotvertolet.youtubejextractor.models.youtube.playerResponse;

import com.github.kotvertolet.youtubejextractor.models.newModels.VideoDetails;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;
import java.util.List;

public class Thumbnail implements Sequenceable,Serializable {
    private List<ThumbnailsItem> thumbnails;

    public static final Sequenceable.Producer<Thumbnail> CREATOR = new Producer<Thumbnail>() {
        @Override
        public Thumbnail createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            Thumbnail thumbnail = new Thumbnail();
            thumbnail.unmarshalling(parcel);
            return thumbnail;
        }
    };

    public List<ThumbnailsItem> getThumbnails() {
        return thumbnails;
    }

    public void setThumbnails(List<ThumbnailsItem> thumbnails) {
        this.thumbnails = thumbnails;
    }

    @Override
    public String toString() {
        return
                "Thumbnail{" +
                        "thumbnails = '" + thumbnails + '\'' +
                        "}";
    }

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeList(this.thumbnails);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        this.thumbnails = parcel.readSequenceableList(ThumbnailsItem.class);
        return true;
    }
}